package org.Dominio;

import java.util.ArrayList;
import java.util.LinkedList;

public class PersonaD {
	private String _user;
	private String _password;
	private String _id;
	private boolean ok = false;
	public GestorPersonas Gpersonas = new GestorPersonas();

	public PersonaD(String u, String p) {
		_user = u;
		_password = p;
	}
	
	public PersonaD getPersona(){
		return new PersonaD(this._user,this._password);
	}

	public String get_usuario() {
		return _user;
	}

	public String get_password() {
		return _password;
	}
	public String get_id(){
		return _id;
	}

	public boolean get_ok(){ return ok; }
	
	public void set_usuario(String aNewuser) {
		_user = aNewuser;
	}

	public void set_password_(String aNewpass) {
		_password = aNewpass;
	}

	public void leer() {
		_id = Gpersonas.read(new PersonaD(_user, _password));
		if (_id == "") {
			ok = false;
		} else {
			ok = true;
		}
	}
}